program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a, b, c, d, i : integer;

begin
  read (a);
  read (b);
  read (c);
  if (a<=b) then
    if (a<=c) then
      d:= a
    else
      d:= c
  else
    if (b<=c) then
      d:= b
    else
      d:= c;
  for i:= 1 to d do
    if (a mod i = 0) then
      if (b mod i = 0) then
        if (c mod i = 0) then
          write (i, ' ');
  readln;
  readln;

end.
